package com.tianji.promotion.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tianji.promotion.domain.po.Coupon;
import com.tianji.promotion.domain.po.CouponScope;
import com.tianji.promotion.domain.po.ExchangeCode;
import com.tianji.promotion.mapper.CouponScopeMapper;
import com.tianji.promotion.service.ICouponScopeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tianji.promotion.utils.CodeUtil;
import io.reactivex.internal.operators.single.SingleCreate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

import static com.tianji.promotion.constants.PromotionConstants.COUPON_CODE_SERIAL_KEY;

/**
 * <p>
 * 优惠券作用范围信息 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-20
 */
@Service
@RequiredArgsConstructor
public class CouponScopeServiceImpl extends ServiceImpl<CouponScopeMapper, CouponScope> implements ICouponScopeService {

    /**
     * 根据兑换券id删除作用范围表
     *
     * @param couponId
     */
    @Override
    public void removeByCouponId(Long couponId) {
         remove(Wrappers.<CouponScope>lambdaQuery().eq(CouponScope::getCouponId,couponId));
    }
}
